<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>网格染色游戏</title>
  <style>
    @keyframes colorChange {
      0% { background-color: var(--from-color); transform: scale(1); }
      50% { background-color: var(--to-color); transform: scale(1.5); }
      100% { background-color: var(--to-color); transform: scale(1); }
    }

    body {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin: 0;
      padding: 20px;
      font-family: Arial, sans-serif;
    }
    #grid {
      display: grid;
      grid-template-columns: repeat(10, 50px);
      grid-template-rows: repeat(8, 50px);
      gap: 2px;
    }
    .cell {
      --from-color: initial;
      --to-color: initial;

      width: 50px;
      height: 50px;
      border: 1px solid #ccc;
      cursor: pointer;
      border-radius: 5px;
      transition: background-color 0.3s ease;
      animation-duration: 1s;
      animation-fill-mode: forwards;
    }
    #controls {
      margin-top: 20px;
      display: flex;
      gap: 10px;
    }
    .color-btn {
      width: 50px;
      height: 50px;
      border: 2px solid #000;
      cursor: pointer;
    }
    #status {
      margin-top: 20px;
      font-size: 1.2em;
    }
  </style>
</head>
<body>
  <h1>网格染色挑战</h1>
  <div id="grid"></div>
  <div id="controls">
    <div class="color-btn" style="background-color: red;" data-color="red"></div>
    <div class="color-btn" style="background-color: blue;" data-color="blue"></div>
    <div class="color-btn" style="background-color: green;" data-color="green"></div>
    <div class="color-btn" style="background-color: yellow;" data-color="yellow"></div>
  </div>
  <div id="status">剩余步数：15</div><div id="target-color">目标颜色<div class="color-btn" style="width: 30px; height: 30px; margin-left: 10px;"></div></div>
  <button id="start-btn">开始游戏</button>
  <script src="game.js"></script>
</body>
</html>